package com.example.base.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
public class BaseEntity implements Serializable {

    //有效
    public static final int ZERO = 0;

    //逻辑删除
    public static final int ONE = 1;

    //主键id 默认雪花算法生成主键
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    public Long id;

    @TableField("create_by")
    public Long createBy;

    @TableField("create_name")
    public String createName;

    @TableField("create_time")
    public LocalDateTime createTime;

    @TableField("update_by")
    public Long updateBy;

    @TableField("update_name")
    public String updateName;

    @TableField("update_time")
    public LocalDateTime updateTime;

    @TableLogic
    @TableField("deleted")
    public int deleted;
}
